class EmployeeTagLib {
def formatDate = { attrs ->
    def date = attrs.get('date')

        if (!date) {
                date = new Date()
        }

        def format = attrs.get('format')        // Gets the format from the view (database) & checks if empty, if so create a new one else error would occur

        if (!format) {
            format = "yyyy-MM-dd"               // Create a String, no default class named format in Java -->
        }

        out << new java.text.SimpleDateFormat(format).format(date) //Java package, text packade, uses the class SimpleDateFormat and the function format in that class with the input date = "yyyy-MM-dd"

   }

    def formatNumber = {attrs-> def number=attrs.get('number')
    if(!number){number=new Double(0)}
    def format=attrs.get('format')
    if(!format){format="0"}
    out<< (new java.text.DecimalFormat(format).format((Double)number)).replaceAll(" ","")}

def formatAdmin = { attrs ->
    def admin = attrs.get('admin')

        if (!admin) {
            out << "No"
        }
        else {
            out << "Yes"
        }


        }
}